import service from '@/utils/request'
// import qs from 'qs'
// eslint-disable-next-line no-unused-vars
const { httpPostForm, httpPost, httpGet } = service

const request = {
    // 招标申请分页查询
    tenderApplyListByEntity (params) {
        return httpPost({
            url: '/tender/apply/listByEntity',
            params
        })
    },
    // 新增招标申请基础信息
    tenderApplyCreate (params) {
        return httpPost({
            url: '/tender/apply/create',
            params
        })
    },
    // 根据id查询招标申请基础信息
    tenderApplyFindById (id) {
        return httpGet({
            url: `/tender/apply/findById/${id}`,
            // params,
            headers: {
                'Content-Type': 'application/x-www-form-urlencoded'
            }
        })
    },
    // 更新招标申请基础信息
    tenderApplyUpdate (params) {
        return httpPost({
            url: '/tender/apply/update',
            params
        })
    },
    // 招标申请批量删除
    tenderApplyDeleteBatch (params) {
        return httpPost({
            url: '/tender/apply/deleteBatch',
            params
        })
    },
    // 招标申请分页查询(新增招标补遗时使用)
    tenderApplyQueryPage (params) {
        return httpPost({
            url: '/tender/apply/queryPage',
            params
        })
    },
    // 新增包件
    bidPackageCreate (params) {
        return httpPost({
            url: '/tender/apply/bidPackage/create',
            params
        })
    },
    // 更新包件
    bidPackageUpdate (params) {
        return httpPost({
            url: '/tender/apply/bidPackage/update',
            params
        })
    },
    // 根据包件ID删除包件
    bidPackageDelete (id) {
        return httpGet({
            url: `/tender/apply/bidPackage/delete/${id}`,
        })
    },
    // 根据billId获取当前单据下的所有包件信息
    bidPackageListByBillId (billId) {
        return httpGet({
            url: `/tender/apply/bidPackage/listByBillId/${billId}`
        })
    },
    // 批量新增招标公文文件
    documentCreate (params) {
        return httpPost({
            url: '/tender/apply/document/create',
            params
        })
    },
    // 招标公文文件分页查询
    documentListByEntity (params) {
        return httpPost({
            url: '/tender/apply/document/listByEntity',
            params
        })
    },
    // 根据招标公文文件ID 批量删除
    documentDelete (params) {
        return httpPost({
            url: '/tender/apply/document/delete',
            params,
            // headers: {
            //     'Content-Type': 'application/x-www-form-urlencoded'
            // }
        })
    },
    // 新增(修改)招标补遗包件信息
    packageCreate (params) {
        return httpPost({
            url: '/tender/change/package/create',
            params
        })
    },
    // G_获取单据相关按钮状态
    getButtonState (params) {
        return httpGet({
            url: '/tender/apply/getButtonState',
            params,
            headers: {
                'Content-Type': 'application/x-www-form-urlencoded'
            }
        })
    },
    // 根据单据ID查询报名包件信息
    findByBillId (billId) {
        return httpGet({
            url: `/tender/enroll/package/findByBillId/${billId}`,
            headers: {
                'Content-Type': 'application/x-www-form-urlencoded'
            }
        })
    },
}

export default request
